/*
 * File:   Camera.h
 * Author: Elevator
 *
 * Created on 30 Март 2013 г., 14:07
 */

#ifndef CAMERA_H
#define CAMERA_H

#include "Common/Common.h"
#include "Core/Core.h"

class Camera : public core::IKeyboardListener
{

public:
	Camera( );
	Camera( const Transform& pos, const Transform& vel, float scale );
	Camera( const Camera& camera );

	virtual ~Camera( );

	inline float GetScale( ) const
	{
		return _scale;
	}

	inline void SetScale( float value )
	{
		_scale = value;
	}

	virtual inline Transform GetPos( ) const
	{
		return _pos;
	}

	virtual inline void SetPos( const Transform& value )
	{
		_pos = value;
	}

	virtual inline Transform GetVel( ) const
	{
		return _vel;
	}

	virtual inline void SetVel( const Transform& value )
	{
		_vel = value;
	}

	virtual void Update( float dt );


	virtual void KeyPressed( core::KeyboardKey key );
	virtual void KeyReleased( core::KeyboardKey key );

private:
	Transform _pos;
	Transform _vel;
	float _scale;
	float _velFactor;
	float _scaleFactor;
	Vec2 _acc;

	static const float SPEED;

	void Accelerate( Vec2 direction );
};
#endif	/* CAMERA_H */
